var db = require('../../config/db')
//查询
exports.search = (req,res)=>{
    //console.log(req.query.vegetableid)
    var sql = 'select * from planting_output where vegetableid=?'
    db.query(sql, req.query.vegetableid, (err, results)=>{
        if(err) return res.cc('400',err)
        if(results.length !== 1) return res.cc('400','获取用户信息失败')
        res.send({ //返回前端信息
            status: 200,
            message: '获取用户信息成功',
            data: results
        })
    })
}